package com.antball.mediator;

public class Main {

    public static void main(String[] args) {
        ConcreteColleagueA pa = new ConcreteColleagueA();
        ConcreteColleagueB pb = new ConcreteColleagueB();

        Mediator mediator = new ConcreteMediator();
        mediator.registered(1,pa);
        mediator.registered(2,pb);

        // sendmsg from a to b
        pa.sendmsg(2,"hello,i am A");
        // sendmsg from b to a
        pb.sendmsg(1,"hello,i am B");
    }
}
